home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip Temmuz 2004.iso / program / antispam / RazorAgent_SDK / razor-agents-sdk-2.03.exe / URI-1.19 / t / news.t < prev    next >
Encoding:
Text File  |  1998-09-11  |  1.3 KB  |  49 lines

  1. print "1..7\n";
  2.  
  3. use URI;
  4.  
  5. $u = URI->new("news:comp.lang.perl.misc");
  6.  
  7. print "not " unless $u->group eq "comp.lang.perl.misc" &&
  8.                     !defined($u->message) &&
  9.             $u->port == 119 &&
  10.             $u eq "news:comp.lang.perl.misc";
  11. print "ok 1\n";
  12.  
  13.  
  14. $u->host("news.online.no");
  15. print "not " unless $u->group eq "comp.lang.perl.misc" &&
  16.                     $u->port == 119 &&
  17.                     $u eq "news://news.online.no/comp.lang.perl.misc";
  18. print "ok 2\n";
  19.  
  20. $u->group("no.perl", 1 => 10);
  21. print "not " unless $u eq "news://news.online.no/no.perl/1-10";
  22. print "ok 3\n";
  23.  
  24. @g = $u->group;
  25. #print "G: @g\n";
  26. print "not " unless @g == 3 && "@g" eq "no.perl 1 10";
  27. print "ok 4\n";
  28.  
  29. $u->message('42@g.aas.no');
  30. #print "$u\n";
  31. print "not " unless $u->message eq '42@g.aas.no' &&
  32.                     !defined($u->group) &&
  33.                     $u eq 'news://news.online.no/42@g.aas.no';
  34. print "ok 5\n";
  35.  
  36.  
  37. $u = URI->new("nntp:no.perl");
  38. print "not " unless $u->group eq "no.perl" &&
  39.                     $u->port == 119;
  40. print "ok 6\n";
  41.  
  42. $u = URI->new("snews://snews.online.no/no.perl");
  43.  
  44. print "not " unless $u->group eq "no.perl" &&
  45.                 $u->host  eq "snews.online.no" &&
  46.                     $u->port == 563;
  47. print "ok 7\n";
  48.  
  49.